package com.music.glide.load

import java.io.IOException

class KHttpException(
    msg: String = DefaultMsg, val code: Int = UnKnown, throwable: Throwable? = null
) : IOException(msg, throwable) {

    constructor(message: String, code: Int) : this(message, code, null)

    constructor(message: String) : this(message, UnKnown)

    constructor(code: Int) : this("${DefaultMsg}:${code}", code)

    companion object {
        const val DefaultMsg = "Http request failed with status code"
        const val UnKnown = -1
    }
}